/**********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       ray.h
 * Author:     karooolek
 * Created on: 2009-10-08
 *
 **********************************************************************************************************************/

#ifndef RAY_H_
#define RAY_H_

#include "shape.h"
#include "vector3.h"

namespace mGameEngine
{

/**
 * Inifinite ray in three-dimensional space.
 */
class Ray : public Shape
{
private:
    /**
     * Direction.
     */
    Vector3 _dir;

    /**
     * Origin.
     */
    Vector3 _origin;

public:
    /**
     * Create ray going in specified direction through origin.
     * @param dir direction.
     * @param origin origin.
     */
    Ray(const Vector3 &dir = Vector3(1.0f, 0.0f, 0.0f),
        const Vector3 &origin = Vector3());

    /**
     * Destroy ray.
     */
    ~Ray();

    /**
     * Get ray direction.
     * @return ray direction.
     */
    const Vector3 &getDirection() const
    {
        return _dir;
    }

    /**
     * Set ray direction.
     * @param dir direction.
     */
    void setDirection(const Vector3 &dir)
    {
        _dir = dir;
    }
    /**
     * Get ray origin.
     * @return ray origin.
     */
    const Vector3 &getOrigin() const
    {
        return _origin;
    }

    /**
     * Set ray origin.
     * @param origin origin.
     */
    void setOrigin(const Vector3 &origin)
    {
        _origin = origin;
    }
};

}

#endif // RAY_H_
